<template>
  <div>
    <zh-form
        :span="8"
        ref="rolePageFrom"
        :labelCol="labelCol"
        :wrapperCol="wrapperCol"
        :model="formData"
        :rules="rules">

      <zh-card title="场景评价信息" style="width:100%">
        <zh-row>
          <zh-input prop="k0402" :disabled="disabled" label="场景名称" v-model="formData.k0402"/>
          <zh-input prop="k0403" :disabled="disabled" label="建设进度" v-model="formData.k0403"/>
          <zh-input prop="k0404" :disabled="disabled" label="巡查数" v-model="formData.k0404"/>
          <zh-input prop="k0405" :disabled="disabled" label="访问量" v-model="formData.k0405"/>
        </zh-row>
      </zh-card>
    </zh-form>
  </div>
</template>

<script>
import {
  getSQAndWz, getZttsCjxxXgDetails, saveZttsCjxxXg
} from "@/services/system/whdngxlApi";
import modal from "ant-design-vue/lib/modal";

export default {
  name: "ZttsCjxxXgForm",
  components: {
  },
  props:{
    listQuery:{
      type:Function,
      default:null
    }
  },
  data() {
    return {
      dictData: {},
      disabled: false,
      formData: {
        k0402:'',
        k0403:'',
        k0404:'',
        k0405:''
      },
      sqData:[],
      labelCol: {
        xs: {span: 24},
        sm: {span: 8},
      },
      wrapperCol: {
        xs: {span: 24},
        sm: {span: 16},
      },
      rules: {},
      visible:false,
    };
  },
  created() {
    this.init();
  },
  methods: {
    init(){

    },
    initData(row, type){
      this.disabled = type === 'view'
      if(row.id){
        this.$http.post(getZttsCjxxXgDetails, {id:row.id}).then((res) => {
          this.formData = res.result;
        });
      }
    },
    saveData() {
      this.$loading.show('正在处理数据,请等待...')
      const params = Object.assign(this.formData)
      setTimeout(() => {
        this.$http.post(saveZttsCjxxXg, params).then((res) => {
          this.$message.info('保存成功')
          this.$emit("handleCancel")
          if(this.listQuery){
            this.listQuery()
          }
          this.$loading.hide()
        }).catch((error) => {
          console.log(JSON.stringify(error))
          this.$loading.hide()
        }).finally(() =>{
        })
      }, 50)
    },
  },
}
</script>

<style scoped>

</style>